<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>企业引导</title>
<link href="/res/css/respective/company/aztCom.css" rel="stylesheet">
<link href="/res/third/select2/css/select2.min.css" rel="stylesheet">
</head>
<body>
	<div class="coverDiv" style="display: none;"></div>
	<div class="bdNote" style="display: none;">
		<img src="/res/images/common/close.jpg" alt="" />
		<div>
			<h5>提醒</h5>
			<h6>您还未绑定任何企业信息，无法进行操作.</h6>
		</div>
		<p style="text-align: center;">
			<button class="blueButt" type="button" style="height: 30px;width: 100px;">我知道了</button>
		</p>
	</div>
	<div class="warp">
		[#include "/front/common/front_headAzt.html"]
		<div class="backcontent">
			[#include "/front/common/front_leftAzt.html"]
			<div class="back-main">
				<div class="mainContent"> 
					<div data-guide>
						<img style="width: 100%;" src="/res/images/respective/company/comSearch_03.jpg" alt="" />
						<div class="guideWhite"> 
						<div style="padding: 0 30px;">
							<div class="guideStep" style="overflow: hidden;">
								<div>
									<h5>申请加入企业</h5>
									<h6>您公司已有企业账号？输入您所在企业的企业名称：</h6>
                                    <select id="company" style="width: 250px;" [#if uac?exists]disabled[/#if]>
									</select>
									<button type="button" onclick="companyApply()" style="margin-left: 3px;vertical-align: middle;" class="blueButt" [#if uac?exists]disabled[/#if]>加入</button>
									<p id="tip" style="margin-top: 5px; display: none;">
										<img alt="" src="/res/images/oparaStatus/warn_07.png"/>
										<span id="msg"></span>
									</p>
									[#if uac?exists]
										<h4 style="margin-top: 80px;">已经申请加入的企业</h4>
										<div>${uac.companyName}</div>
									[/#if]
								</div>
								<div style="float: right;">
									<h5>创建企业账号</h5>
									<h6>您公司还没有企业账号？您需要准备以下资料：</h6>
									<ul>
										<li style="background-position: center 6px;">企业基本资料</li>
										<li style="background-image: url(/res/images/respective/company/comThre.png);">企业营业执照 </li>
										<li style="background-image: url(/res/images/respective/company/comOne.png);">企业财务信息</li>
									</ul>
									<p style="text-align: center;padding-top: 25px;">
										<button type="button" class="blueButt" style="width: 160px;height: 45px;font-size: 18px;" onclick="location.href='/company/info'">创建企业账号</button>
									</p> 
								</div>
							</div>
						</div>
					</div>
					<img style="width: 100%;margin-top: 20px;" src="/res/images/respective/company/footCom.jpg" alt="" />
				</div>  
				</div>
			</div>
			<!-- 底部菜单-->
			[#include "/front/common/front_footerAzt.html"]
		</div>
	</div>
	<script src="/res/js/common/common.js" type="text/javascript"></script>
    <script src="/res/third/layer/layer.js" type="text/javascript"></script>
    <script src="/res/third/select2/js/select2.full.min.js" type="text/javascript"></script>
    <script src="/res/third/select2/js/i18n/zh-CN.js" type="text/javascript"></script>
	<script type="text/javascript">
		$(function() {
			[#if Session.currentUser?? && Session.currentUser.companyId??]
				layer.alert("无法加入企业，请先到帐号设置中退出当前公司",
					{closeBtn : 0, btn : ['去帐号设置']},
					function() {
					location.href = '/safecenter/personalData';
				});
			[/#if]
		});

        $('#company').select2({
            language: "zh-CN",
            placeholder : '请输入企业名称或关键字',
            allowClear : true,
            ajax : {
                url : '/user/searchCompany',
                type : 'post',
                dataType : 'json',
                delay : 250,
                data : function(param) {
                    return {
                        keyword : param.term,
                        page : param.page || 1
                    }
                },
                processResults : function(res, param) {
                    var data = res.data;
                    var options = [];
                    $.each(data, function () {
                        options.push({id : this.companyId, text : this.companyName});
                    });
                    return {
                        results: options,
                        pagination: {
                            more: res.hasNext
                        }
                    };
                },
                cache : true,
            },
            escapeMarkup: function (markup) { return markup; },
            minimumInputLength: 1
        });

		$('#company').on('select2:select', function(e) {
            hideTip();
		});

        function showTip(msg) {
            $('#msg').html(msg);
            $('#tip').show();
        }

        function hideTip() {
            $('#msg').html('');
            $('#tip').hide();
        }

        function companyApply() {
            var company = $('#company').val();
            if($.trim(company) != '') {
                window.location.href = '/user/companyApply/' + company;
            } else {
                showTip("请选择需要加入的企业");
            }
        }
	</script>
</body>
</html>
		